package org.dromara.business.mapper;

import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.dromara.business.domain.LzshBusinessInfo;
import org.dromara.business.domain.bo.LzshBusinessInfoBo;
import org.dromara.business.domain.vo.LzshBusinessInfoVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.common.mybatis.core.page.PageQuery;

import java.util.List;

/**
 * business信息Mapper接口
 *
 * @author sxl
 * @date 2024-08-19
 */
public interface LzshBusinessInfoMapper extends BaseMapperPlus<LzshBusinessInfo, LzshBusinessInfoVo> {
/*    @Select("SELECT * FROM lzsh_business_info LIMIT #{pageSize} OFFSET #{pageNum}")
    @Results({
        @Result(property = "userInfo", column = "user_info", typeHandler = JacksonTypeHandler.class),
        @Result(property = "template", column = "template", typeHandler = JacksonTypeHandler.class),
        @Result(property = "oldPlans", column = "old_plans", typeHandler = JacksonTypeHandler.class),
        @Result(property = "newPlans", column = "new_plans", typeHandler = JacksonTypeHandler.class)
    })*/
    List<LzshBusinessInfoVo> selectListVo(LzshBusinessInfoBo bo, PageQuery pageQuery);

    @Select("SELECT * FROM lzsh_business_info WHERE id = #{id} ")
    @Results({
        @Result(property = "userInfo", column = "user_info", typeHandler = JacksonTypeHandler.class),
        @Result(property = "template", column = "template", typeHandler = JacksonTypeHandler.class),
        @Result(property = "oldPlans", column = "old_plans", typeHandler = JacksonTypeHandler.class),
        @Result(property = "newPlans", column = "new_plans", typeHandler = JacksonTypeHandler.class)
    })
    LzshBusinessInfoVo selectById(Long id);

}
